/*
 * Created by Jaren at 2021/10/29 10:50
 */
import 'package:ble_plugin_example/base/base.dart';
import 'package:ble_plugin_example/operation/operation_controller.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';

class OperationPage extends BaseView<OperationController> {

    _buildRealTimeInfoView(OperationController controller) {
        return Column(
            mainAxisSize: MainAxisSize.min,
            children: [
                Text(controller.hashCode.toString()),
                MaterialButton(onPressed: () => controller.disconnectCurrent(), child: Text("Disconnect[No flag]")),
                MaterialButton(onPressed: () => controller.disconnectCurrent(flag: "OPERATION_PAGE"), child: Text("Disconnect[Flag->OPERATION_PAGE]")),
            ],
        );
    }

    @override
    Widget build(BuildContext context) {
        super.build(context);
        return Scaffold(
            body: Center(
                child: Column(
                    mainAxisSize: MainAxisSize.min,
                    children: [
                        _buildRealTimeInfoView(controller),
                    ],
                ),

            ),
        );
    }
}